package com.gxks.lhs.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gxks.lhs.entity.Favorite;
import com.gxks.lhs.entity.Goods;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 收藏表 Mapper 接口
 * </p>
 *
 * @author LuoHaisong
 * @since 2023-05-18
 */
public interface FavoriteMapper extends BaseMapper<Favorite> {
    @Select("select * from goods where id in (select goods_id from favorite where user_id = #{userId})")
    List<Goods> getFavoriteList(String userId, Integer page, Integer size);

}
